﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace BookOnline.Data
{
    public class News
    {
        private static string _NewsID;
        private static string _NewsTitle;
        private static string _NewsText;
        private static string _NewsStatus;

        public string NewsID { get { return _NewsID; } set { _NewsID = value; } }
        public string NewsTitle { get { return _NewsTitle; } set { _NewsTitle = value; } }
        public string NewsText { get { return _NewsText; } set { _NewsText = value; } }
        public string NewsStatus { get { return _NewsStatus; } set { _NewsStatus = value; } }

        public News NewsIDataReader(IDataReader dr)
        {
            Data.News obj = new News();
            obj.NewsID=(dr["NewsID"] is DBNull)?string.Empty:dr["NewsID"].ToString();
            obj.NewsTitle = (dr["NewsTitle"] is DBNull) ? string.Empty : dr["NewsTitle"].ToString();
            obj.NewsText = (dr["NewsText"] is DBNull) ? string.Empty : dr["NewsText"].ToString();
            obj.NewsStatus = (dr["NewsStatus"] is DBNull) ? string.Empty : dr["NewsStatus"].ToString();
            return obj;
        }
    }
}
